/// StatelessWidget用于不需要维护状态的场景，
/// 它通常在build方法中通过嵌套其它Widget来构建UI，
/// 在构建过程中会递归的构建其嵌套的Widget

import 'package:flutter/material.dart';

class Echo extends StatelessWidget {
  final String? text;
  final Color backgroundColor;

  const Echo({
    Key? key,
    @required this.text,
    this.backgroundColor: Colors.grey,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Center(
      child: Container(
        color: backgroundColor,
        child: Text(text ?? ""),
      ),
    );
  }
}
